package com.lx.pc.service.tendering.impl;

import java.math.BigInteger;
import java.util.List;

import org.springframework.stereotype.Service;

import com.lx.pc.domain.entity.tendering.TenderingEntity;
import com.lx.pc.domain.vo.tendering.TenderingVo;
import com.lx.pc.mybatis.repository.tendering.TenderingRepository;
import com.lx.pc.service.AbstractService;
import com.lx.pc.service.tendering.ITenderingService;
import com.lx.pc.utils.OmsPage;

@Service("tenderingService")
public class TenderingServiceImpl extends AbstractService<TenderingEntity, TenderingVo, BigInteger, TenderingRepository> implements ITenderingService{

	@Override
	public int findByTenderingCount(TenderingVo tendering) {

		return repository.findByTenderingCount(tendering);
	}
	
	@Override
	public OmsPage<TenderingVo> findByTendering(TenderingVo tendering, Integer page, Integer size) {
		OmsPage<TenderingVo> pages = new OmsPage<TenderingVo>();
		pages.setTotal(repository.findByTenderingCount(tendering));
		List<TenderingEntity> list = repository.findByTendering(tendering,page = (page - 1) * size,size);
		pages.setResult(etoV(list));
		return pages;
	}

	

}
